;*******************************************************************************
; Director - Constants - This file holds constants definitions
;
; Copyright (C) 2002, Nick Craig-Wood and the RISC OS Director Developers
;
;This program is free software; you can redistribute it and/or modify it under
;the terms of the GNU General Public License as published by the Free Software
;Foundation; either version 2 of the License, or (at your option) any later
;version.
;
;This program is distributed in the hope that it will be useful, but WITHOUT ANY
;WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
;PARTICULAR PURPOSE. See the GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License along with
;this program; if not, write to the Free Software Foundation, Inc., 59 Temple
;Place - Suite 330, Boston, MA 02111-1307, USA
;
;*******************************************************************************
;----h- Director.h.Constants
; Name
;   Constants
;
; Purpose
;   Constants
;------
;*******************************************************************************

		TTL > Consts - This file holds constants definitions

SwiChunk	EQU	&4A100
ErrorChunk	EQU	&80D000

		GBLL	DEBUG
DEBUG		SETL	{FALSE}

;General constants

		GBLS	cr
		GBLS	hs
		GBLS	crlf
cr		SETS	:CHR: &D
hs		SETS	:CHR: &1F
crlf		SETS	(:CHR: &D) :CC: (:CHR: &A)

;MenuEntry Types, these are stored in the ESG of menu entries
;The submenu pointer declares whether there is a sub-menu or not

			^	0
MenuEntryText		#	1			;normal text entry, no action on click, submenu after validation
MenuEntryFile		#	1			;path marked in block + '.' + Entry
MenuEntryPath		#	1			;path is after end of validation string
MenuEntryPathUp		#	1			;ditto but with upmenus
MenuEntryPathMenuMenu	#	1			;ditto but opens menu menu
MenuEntryCommand1	#	1			;command is after end of validation string or sub-menu name
MenuEntryCommand2	#	1			;2 commands after "

;key modifiers as returned by ReadKeyModifiers

ShiftMod	EQU	1 << 16
CtrlMod		EQU	2 << 16
AltMod		EQU	4 << 16

;for OS_ReadArgs

scratch_size		EQU	512


;PollWord types

$Name._PollWord_CreateIcon	EQU	1 << 0		; 1
$Name._PollWord_DirectorEdit	EQU	1 << 1		; 2
$Name._PollWord_DirectorURL	EQU	1 << 2		; 4
$Name._PollWord_CreateWindow	EQU	1 << 3		; 8
$Name._PollWord_DeleteWindow	EQU	1 << 4		; 16

;Messages

Message_$Name.OpenMenu	EQU	SwiChunk+0
Message_$Name.Window	EQU	SwiChunk+1

				^	0
$Name._MessageOpenMenu_ptr	#       Wimp_Pointer
$Name._MessageOpenMenu_menu	#       256 - Wimp_Message_data - @
$Name._MessageOpenMenu		*       @

				^	0
$Name._MessageWindow_type	#       4
$Name._MessageWindow_handle	#       4
$Name._MessageWindow_data	#       256 - Wimp_Message_data - @
$Name._MessageWindow		*       @

; Director Status

$Name._Status_Init		#	1	; Director is Initialising
$Name._Status_Run		#	2	; Director is running
$Name._Status_Quit		#	3	; Director is quitting

; DirectorURL Status

$Name._URL_NotClaimed		EQU	0	; URL not yet proccesed
$Name._URL_InetSuite		EQU	1	; URL being processed by InetSuite
$Name._URL_InetSuite_fail	EQU	2	; URL being processed by InetSuite failed

; Director Window status

Window_Create		EQU	0	; Window to be created
Window_Running		EQU	1	; Window created
Window_Delete		EQU	2	; Window to be deleted


;Extra icon numbers

Wimp_IconIconBar		EQU	&FFFFFF00

Wimp_ClickOpen			EQU	&FFFFFF01
Wimp_ClickClose			EQU	&FFFFFF02
Wimp_ClickNull			EQU	&FFFFFF03
Wimp_ClickDragTo		EQU	&FFFFFF04
Wimp_ClickDragFrom		EQU	&FFFFFF05
Wimp_ClickInit			EQU	&FFFFFF06
Wimp_ClickTornOff		EQU	&FFFFFF07
Wimp_ClickDelete		EQU	&FFFFFF08
Wimp_ClickHelp			EQU	&FFFFFF09
Wimp_ClickQuit			EQU	&FFFFFF0A

; Definitions for DirectorIcon types

$Name._IconBlock_Text_BlankText		EQU	0
$Name._IconBlock_Text_Time		EQU	1
$Name._IconBlock_Text_FreeDisc		EQU	2
$Name._IconBlock_Text_UsedDisc		EQU	3
$Name._IconBlock_Text_FreeMem		EQU	4
$Name._IconBlock_Text_UsedMem		EQU	5

;*******************************************************************************
;Errors
;*******************************************************************************

		ERRInit		ErrorChunk+&80			;base for un-numbered errors

		MACRO
		DefineError	$name
Error_$name	#		1
		GBLS		$name
$name		SETS		"Error_$name"
		MEND

		^		ErrorChunk
		DefineError	ModuleCorrupted
		DefineError	BadParameter
		DefineError	KeyNotFound
		DefineError	NotDeskTop
		DefineError	MenuNotFound
		DefineError	NoTextOrPath
		DefineError	NotPathAndSub
		DefineError	CantAddCommand
		DefineError	BufferTooSmall
		DefineError	NoSprite
		DefineError	NoTemplate
		DefineError	NotLeftAndRight
		DefineError	LineTooLong
		DefineError	TaskNotFound
		DefineError	IconNotFound
		DefineError	WindowNotFound
		DefineError	MenuNotFoundOrDisplayed
		DefineError	NoMarker
		DefineError	NotInStringBlock
		DefineError	OnlyToFiler
		DefineError	DataXferFailed
		DefineError	NoReplyToDataSave
		DefineError 	NoAllowWithoutLen
		DefineError	CannotEditFile
		DefineError	CannotLaunchURL

;		MACRO
;		DefineError	$name,	$text
;Error_$name	#		1
;		GBLS		$name
;$name		SETS		"$text"
;		MEND

;		^		ErrorChunk
;		DefineError	ModuleCorrupted,		"Module has become corrupted"
;		DefineError	BadParameter,			"Bad parameter"
;		DefineError	KeyNotFound,			"Key not found"
;		DefineError	NotDeskTop,			"Use *DeskTop_DirectorTask from the Wimp or with *WimpTask"
;		DefineError	MenuNotFound,			"Menu not found"
;		DefineError	NoTextOrPath,			"<text> or -path missing from menu option"
;		DefineError	NotPathAndSub,			"-path and -sub are incompatible"
;		DefineError	CantAddCommand,			"Can't add command to last option"
;		DefineError	BufferTooSmall,			"Buffer too small"
;		DefineError	NoSprite,			"<sprite> must be supplied"
;		DefineError	NoTemplate,			"<template> must be supplied"
;		DefineError	NotLeftAndRight,		"-left and -right incompatible"
;		DefineError	LineTooLong,			"Line too long"
;		DefineError	TaskNotFound,			"Task not found"
;		DefineError	IconNotFound,			"Icon not found"
;		DefineError	WindowNotFound,			"Window not found"
;		DefineError	MenuNotFoundOrDisplayed,	"Menu not found or being displayed"
;		DefineError	NoMarker,			"No marker in string block"
;		DefineError	NotInStringBlock,		"Not within string block"
;		DefineError	OnlyToFiler,			"Can DataSave only to Filer"
;		DefineError	DataXferFailed,			"Data transfer failed: Receiver died"
;		DefineError	NoReplyToDataSave,		"No reply to DataSave"
;		DefineError 	NoAllowWithoutLen, 		"Cannot have -allow without -len"
;		DefineError	CannotEditFile,			"Cannot load file to edit."
;		DefineError	CannotOpenURL,			"Cannot open URL."

;*******************************************************************************
		END
